<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>封面管理</title>
 <link rel="stylesheet" type="text/css" href="../../js/imgareaselect/css/imgareaselect-default.css" />
 <script type="text/javascript" src="../../js/easyui/jquery-1.7.1.min.js"></script>
 <script type="text/javascript" src="../../js/imgareaselect/scripts/jquery.imgareaselect.pack.js"></script>


<script>
	$(document).ready(function() {
		$('#cover').imgAreaSelect( {
			aspectRatio : $("#aspectRatio").val(),
			handles : true,
			onSelectChange : function(img, selection) {
				$("#x").val(selection.x1);
				$("#y").val(selection.y1);
				$("#width").val(selection.width);
				$("#height").val(selection.height);

			}

		});
	});
</script>
</head>
<body>

<table width="100%">
    <tr>
        <td>
            <img id="cover" src="../../gallery/<s:property value="album.id" />/cover/<s:property value="coverFolder" />/<s:property value="album.cover" />"/>
        </td>
    </tr>
</table>
<table width="100%">
    <tr>
        <td>
            <form id="coverForm" action="tailor_cover.action">
                <table>
                    <tr>
                        <td>长度：</td>
                        <td><input id="width" name="area.width"/></td>
                    </tr>
                    <tr>
                        <td>宽度：</td>
                        <td><input id="height" name="area.height"/></td>
                    </tr>
                </table>
                <input type="hidden" id="x" name="area.x" value="<s:property value="area.x" />"></input>
				<input type="hidden" id="y" name="area.y" value="<s:property value="area.y" />"></input>
                <input type="hidden" id="aspectRatio" name="aspectRatio" value="<s:property value="aspectRatio" />"></input>
				<input type="hidden" name="album.id" value="<s:property value="album.id" />"></input>
				<input type="hidden" name="coverType" value="<s:property value="coverType" />"></input>
				<input type="submit" value="提交">
            </form>
        </td>
    </tr>
</table>

</body>
</html>